home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
allfiles
/
Centri
/
Centri.dir
/
00293_Script_293
< prev
next >
Wrap
Text File
|
1999-02-25
|
1KB
|
33 lines
on spriteToFront sNum
set sList to []
repeat with i = sNum to 48
if the castNum of sprite i > 0 then append sList,i
end repeat
set frontSprite to getLast(sList)
set frontProps to birth(script "spriteProps",getAt(sList,1))
repeat with i = 1 to count(sList) - 1
set targetSprite to getAt(sList,i)
set sourceSprite to getAt(sList,i+1)
set theProps to birth(script "spriteProps",sourceSprite)
puppetSprite targetSprite,true
setProps(theProps,targetSprite)
end repeat
puppetSprite frontSprite,true
setProps(frontProps,frontSprite)
updateStage
return frontSprite
end
on castToFront cNum -- cNum can also be the name of the cast
set cNum to the number of cast cNum
set frontSprite to 0
if cNum > 0 then
set scList to []
repeat with i = 1 to 48
append scList,the castNum of sprite i
end repeat
set sNum to getOne(scList,cNum)
if sNum > 0 then set frontSprite to spriteToFront(sNum)
end if
return frontSprite
end